/*
 * @Author: zhuxiaoyi
 * @Date: 2023-05-11 15:23:03
 * @LastEditor: zhuxiaoyi
 * @LastEditTime: 2023-12-24 13:36:30
 * @Description:
 */
import { createWebHistory, createRouter, RouteRecordRaw } from "vue-router";
const routes: Array<RouteRecordRaw> = [
    {
        path: "/login",
        name: "Login",
        meta: {
            title: "登录",
            keepAlive: true,
            requireAuth: false,
        },
        component: () => import("@/views/login/login.vue"),
    },
    {
        path: "/index",
        name: "Index",
        meta: {
            title: "灌区灌溉遥感动态监测系统",
        },
        redirect: "index/process",
        component: () => import("@/views/index/index.vue"),
        children: [
            {
                path: "process",
                name: "Process",
                meta: {
                    title: "灌区遥感监测任务配置",
                },
                component: () => import("@/views/index/process/process.vue"),
                children: [
                    {
                        path: "model",
                        name: "Model",
                        meta: {
                            title: "模型注册",
                        },
                        component: () => import("@/views/index/process/model/model.vue"),
                    },
                    {
                        path: "task",
                        name: "Task",
                        meta: {
                            title: "算法注册",
                        },
                        component: () => import("@/views/index/process/task/task.vue"),
                    },
                ],
            },
            {
                path: "review",
                name: "Review",
                meta: {
                    title: "灌区遥感监测任务管理",
                },
                children: [
                    {
                        path: "publish",
                        name: "Publish",
                        meta: {
                            title: "成果发布",
                        },
                        component: () => import("@/views/index/review/publish/publish.vue"),
                    },
                ],
                component: () => import("@/views/index/review/review.vue"),
            },
            {
                path: "display",
                name: "Dispaly",
                meta: {
                    title: "灌区灌溉动态监测成果管理",
                },
                component: () => import("@/views/index/display/display.vue"),
            },
            {
                path: "display1",
                name: "Dispaly1",
                meta: {
                    title: "灌区灌溉动态监测成果管理",
                },
                component: () => import("@/views/index/display1/display1.vue"),
            },
            {
                path: "display3",
                name: "display3",
                meta: {
                    title: "田间水循环模拟结果展示",
                },
                component: () => import("@/views/index/display3/display3.vue"),
            },
            {
                path: "display2",
                name: "display2",
                meta: {
                    title: "灌区灌溉动态监测成果管理",
                },
                component: () => import("@/views/index/display2/display2.vue"),
            },
            {
                path: "flow",
                name: "flow",
                meta: {
                    title: "任务流程",
                },
                component: () => import("@/views/index/flow/flow.vue"),
            },
            {
                path: "flow1",
                name: "flow1",
                meta: {
                    title: "任务流程1",
                },
                component: () => import("@/views/index/flow/flow1.vue"),
            },
            {
                path: "flow2",
                name: "flow2",
                meta: {
                    title: "任务流程2",
                },
                component: () => import("@/views/index/flow/flow2.vue"),
            },
            {
                path: "flow3",
                name: "flow3",
                meta: {
                    title: "任务流程3",
                },
                component: () => import("@/views/index/flow/flow3.vue"),
            },
            {
                path: "users",
                name: "users",
                meta: {
                    title: "用户管理",
                },
                component: () => import("@/views/index/users/users.vue"),
            },
            {
                path: "userInfo",
                name: "userInfo",
                meta: {
                    title: "用户信息",
                },
                component: () => import("@/views/index/users/userInfo.vue"),
            },
        ],
    },
    {
        path: "/",
        redirect: "/index",
        meta: {
            title: "",
        },
    },
    {
        path: "/404",
        name: "404",
        component: () => import("../views/errorPage/404Page.vue"),
    },
    {
        path: "/:catchAll(.*)",
        redirect: "/404",
    },
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});
export default router;
